package com.gxa.web_admin.controller.zy;


import com.gxa.modules.core.OrderFileExcelExport;
import com.gxa.modules.dto.OrderFileVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;


/**
 * 顺序文件控制器
 *
 * @author kk
 * @date 2023/03/24
 */
@RequestMapping("/orderfile")
@Controller
public class OrderFileController {
    @Autowired
    private OrderFileExcelExport orderFileExcelExport;
    @RequestMapping(value ="/findOrderList",method = RequestMethod.POST)

    public void findOrderList(HttpServletResponse response,@RequestBody OrderFileVo orderFileVo) throws IOException {
        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
        response.setCharacterEncoding("utf-8");

        String fileName = URLEncoder.encode("测试", "UTF-8").replaceAll("\\+", "%20");

       orderFileExcelExport.exportWithSmallData(response,fileName,orderFileVo);






    }
}
